//
//  DDShopTitleView.m
//  Dingdong
//
//  Created by 程强 on 16/11/16.
//  Copyright © 2016年 程强. All rights reserved.
//

#import "DDShopTitleView.h"
#import "ImageScrollView.h"

@interface DDShopTitleView()
@property (strong, nonatomic) UIImageView *logo;
@property (strong, nonatomic) KKLabel *shopNameLbl;
@property (strong, nonatomic) ImageScrollView *imageScroll;
@end

@implementation DDShopTitleView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UIView *topBackView = [[UIView alloc]init];
        [self addSubview:topBackView];
        topBackView.backgroundColor = [UIColor redColor];
        [topBackView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(self);
            make.height.equalTo(@55);
        }];
        
        self.logo = [[UIImageView alloc]init];
        [topBackView addSubview:_logo];
        [_logo mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(topBackView);
            make.left.equalTo(topBackView).offset(20);
            make.width.height.equalTo(@50);
        }];
        
        self.shopNameLbl = [[KKLabel alloc]initWithBlock:^(KKLabel *lbl) {
            lbl.laText(@"小丽家官方旗舰店",[UIColor blackColor],[UIFont systemFontOfSize:15.0],NSTextAlignmentLeft);
        }];
        [topBackView addSubview:_shopNameLbl];
        [_shopNameLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(topBackView).offset(15);
            make.left.equalTo(_logo.mas_right).offset(10);
            make.height.equalTo(@25);
        }];
        
        UIView *adBackView = [[UIView alloc]init];
        [self addSubview:adBackView];
        adBackView.backgroundColor = [UIColor greenColor];

        [adBackView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self);
            make.top.equalTo(topBackView.mas_bottom);
        }];
        
        self.imageScroll = [[ImageScrollView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenWidth*0.5)];
        _imageScroll.pics = @[@"",@"",@""];
        _imageScroll.placePics = @[@"",@"",@""];
        [adBackView addSubview:_imageScroll];
        [_imageScroll reloadView];
    }
    return self;
}
@end
